//package com.xxx.service;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.exception.MQClientException;
//import org.apache.rocketmq.client.producer.TransactionMQProducer;
//import org.apache.rocketmq.client.producer.TransactionSendResult;
//import org.apache.rocketmq.common.message.Message;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
///**
// * rocketmq事务消息生产者③
// */
//@Slf4j
//@Service
//public class TxMessageProducer {
//
//    @Autowired
//    private TransactionMQProducer transactionMQProducer;
//
//    /**
//     * 同步发送事务消息
//     */
//    public void sendTxMessage(String topic, String msg) throws MQClientException {
//        Message message = new Message(topic, msg.getBytes());
//        TransactionSendResult sendResult = transactionMQProducer.sendMessageInTransaction(message, null);
//        log.info("事务消息发送结果: " + sendResult);
//    }
//}
